﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;

namespace RRTWSDSD.ServiceUtilidad
{
    /// <summary>
    /// Summary description for GenerarTicketService
    /// </summary>
    [WebService(Namespace = "http://rtt.edu.upc.com.pe/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class GenerarTicketService : System.Web.Services.WebService
    {

        [WebMethod]
        public string generarTicket(int id_cli)
        {
            Random rnd = new Random();
            int month = rnd.Next(1, 13); // creates a number between 1 and 12
            int dice = rnd.Next(1, 7); // creates a number between 1 and 6
            int card = rnd.Next(52); // creates a number between 0 and 51
            string icket = month + "0-0" + dice + "0-0" + card + "0-0" + id_cli;
            return icket;
        }
    }
}
